
package wviz.index;


//@Deprecated // by Two words
public class TwoWordsInfo implements Comparable {

    private double distance;

    private String word0, word1;
    
    public TwoWordsInfo(String t0, String t1, double d) {
        word0 = t0;
        word1 = t1;
        distance = d;
     }

    public int compareTo(Object o) {
        TwoWordsInfo twi = (TwoWordsInfo) o;

        if (twi.distance > distance) {
            return 1;
        } else
        if (twi.distance < distance) {
            return -1;
        } else {
            return 0;
        }
    }
    
    /**
     * This is for index containing multiple documents.  If new case of term0
     * and term1 is found then add distance found in that document
     */
    public void addClose(Double d) {
        distance += d;
    }

    public double getDistance() {
        return distance;
    }

    public void setDistance(double d) {
        distance = d;
    }    

    public String getWord0() {
    	return StemmingInformation.getMostFrequentSurfaceForm(word0);
        //return word0;
    }

    public String getWord1() {
    	return StemmingInformation.getMostFrequentSurfaceForm(word1);
    	//return word1;
    }
}
